﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;

namespace PeshoMVC.MyHelpers
{
    public class Bind
    {
        public static List<SelectListItem> Genders()
        {
            List<SelectListItem> genderList = new List<SelectListItem>()
            {
                new SelectListItem { Text = "default", Value = "default"},
                new SelectListItem { Text = "male", Value = "male" },
                new SelectListItem { Text = "female", Value = "female" }
            };

            return genderList;
        }

        public static List<SelectListItem> Pets()
        {
            List<SelectListItem> petList = new List<SelectListItem>()
            {
                new SelectListItem { Text = "default", Value = "default"},
                new SelectListItem { Text = "Cat", Value = "Cat" },
                new SelectListItem { Text = "Dog", Value = "Dog" },
                new SelectListItem { Text = "Fish", Value = "Fish" },
                new SelectListItem { Text = "Hamster", Value = "Hamster" },
                new SelectListItem { Text = "Other", Value = "Other" },
                new SelectListItem { Text = "I don't nave a pet", Value = "I don't nave a pet" }
            };

            return petList;
        }

        public static List<SelectListItem> Days()
        {
            List<SelectListItem> days = new List<SelectListItem>()
            {
                new SelectListItem { Text = "day", Value = "0"},
            };

            for (int i = 1; i < 32; i++)
            {
                days.Add(new SelectListItem { Text = i.ToString(), Value = i.ToString() });
            }

            return days;
        }

        public static List<SelectListItem> Mounts()
        {
            List<SelectListItem> mounts = new List<SelectListItem>()
            {
                new SelectListItem { Text = "mount", Value = "0"},
                new SelectListItem { Text = "January", Value = "1" },
                new SelectListItem { Text = "February", Value = "2" },
                new SelectListItem { Text = "March", Value = "3" },
                new SelectListItem { Text = "April", Value = "4" },
                new SelectListItem { Text = "May", Value = "5" },
                new SelectListItem { Text = "June", Value = "6" },
                new SelectListItem { Text = "July", Value = "7" },
                new SelectListItem { Text = "August", Value = "8" },
                new SelectListItem { Text = "September", Value = "9" },
                new SelectListItem { Text = "October", Value = "10" },
                new SelectListItem { Text = "November", Value = "11" },
                new SelectListItem { Text = "December", Value = "12" },
            };

            return mounts;
        }

        public static List<SelectListItem> Years()
        {
            List<SelectListItem> years = new List<SelectListItem>()
            {
                new SelectListItem { Text = "year", Value = DateTime.Now.Year.ToString()},
            };

            for (int i = DateTime.Now.Year; i > 1900; i--)
            {
                years.Add(new SelectListItem { Text = i.ToString(), Value = i.ToString() });
            }

            return years;
        }

        public static List<SelectListItem> YearsFrom()
        {
            List<SelectListItem> years = new List<SelectListItem>()
            {
                new SelectListItem { Text = "year", Value = new DateTime(1990, 1, 1).Year.ToString()},
            };

            for (int i = 1900; i < DateTime.Now.Year; i++)
            {
                years.Add(new SelectListItem { Text = i.ToString(), Value = i.ToString() });
            }

            return years;
        }
    }
}